import { post, get } from '@/utils/request'

const addArticle = params => post('/article/add', params)
const updateConsult = params => post('/consult/update', params)
const deleteArticle = (params) => get(`/article/delete/${params.id}`)
const getArticle = (params) => get(`/article/${params.id}`)
const listArticle = () => get('/article/list')
const pageArticle = (params) => get(`/article/page/${params.pageNum}/${params.pageSize}`)
const searchArticle = (params) => get(`/article/search/${params.title}/${params.pageNum}/${params.pageSize}`)

export {
  addArticle,
  updateConsult,
  getArticle,
  listArticle,
  deleteArticle,
  pageArticle,
  searchArticle
}
